Skip to content

Conversation

@Nayana-R-Gowda
Copy link
Collaborator

Signed-off-by: NAYANAR [email protected]
This change introduces a centralized, priority-based background task scheduler to coordinate all periodic tasks.

I validated the behavior using controlled asyncio tests that demonstrate:

elimination of overlapping background task execution

strict priority ordering (CRITICAL → HIGH → NORMAL → LOW)

enforced concurrency limits via a semaphore

predictable execution under load

Compared to the previous timer-based approach, this prevents DB connection spikes, reduces resource contention, and ensures critical system tasks are not delayed by housekeeping jobs.

Signed-off-by: NAYANAR <[email protected]>
Signed-off-by: NAYANAR <[email protected]>
Signed-off-by: NAYANAR <[email protected]>
@jonpspri
Copy link
Collaborator

Hello @Nayana-R-Gowda and thank you for the PR. Please move creation of the TaskScheduler class from the services/init.py file into utils/task_scheduler.py . Once the imports have been synchronized that may clear up the linting issues.

Please also be sure to rebase against the upstream repository and sign your commits. You may wish to squash commits to date when you rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants